import React, {lazy} from "react";
import {
  HomeOutlined,
  PictureOutlined,
  MenuOutlined
} from '@ant-design/icons';

const Home = () => {
  return import('./../../views/home')
}
const addBanner = () => {
  return import('./../../views/banner/Add')
}
const bannerList = () => {
  return import('./../../views/banner')
}

const proList = () => {
  return import('./../../views/pro')
}

const seckill = () => {
  return import('./../../views/pro/Seckill')
}
const recommend = () => {
  return import('./../../views/pro/Recommend')
}
const search = () => {
  return import('./../../views/pro/Search')
}

const user = () => {
  return import('./../../views/user')
}
const admin = () => {
  return import('./../../views/user/Admin')
}

const settings = () => {
  return import('./../../views/setting')
}

const routes = [
  {
    key: '0-0',
    path: '/',
    title: '系统首页',
    icon: <HomeOutlined/>,
    component: lazy(Home)
  },
  {
    key: '0-1',
    path: '/banner',
    title: '轮播图管理',
    icon: <PictureOutlined/>,
    redirect: '/banner/list',
    children: [
      {
        key: '0-1-0',
        path: '/banner/list',
        title: '轮播图列表',
        icon: <MenuOutlined/>,
        component: lazy(bannerList)
      },
      {
        key: '0-1-1',
        path: '/banner/add',
        title: '添加轮播图',
        icon: <MenuOutlined/>,
        component: lazy(addBanner)
      }
    ]
  },
  {
    key: '0-2',
    path: '/pro',
    title: '产品管理',
    icon: <PictureOutlined/>,
    redirect: '/pro/list',
    children: [
      {
        key: '0-2-0',
        path: '/pro/list',
        title: '产品列表',
        icon: <MenuOutlined/>,
        component: lazy(proList)
      },
      {
        key: '0-2-1',
        path: '/pro/seckill',
        title: '秒杀列表',
        icon: <MenuOutlined/>,
        component: lazy(seckill)
      },
      {
        key: '0-2-2',
        path: '/pro/recommend',
        title: '推荐列表',
        icon: <MenuOutlined/>,
        component: lazy(recommend)
      },
      {
        key: '0-2-3',
        path: '/pro/search',
        title: '筛选列表',
        icon: <MenuOutlined/>,
        component: lazy(search)
      }
    ]
  },
  {
    key: '0-3',
    path: '/user',
    title: '账户管理',
    icon: <PictureOutlined/>,
    redirect: '/user/list',
    children: [
      {
        key: '0-3-0',
        path: '/user/list',
        title: '用户列表',
        icon: <MenuOutlined/>,
        component: lazy(user)
      },
      {
        key: '0-3-1',
        path: '/user/admin',
        title: '管理员列表',
        icon: <MenuOutlined/>,
        component: lazy(admin)
      }
    ]
  },
  {
    key: '0-4',
    path: '/setting',
    title: '设置',
    icon: <HomeOutlined />,
    component: lazy(settings),
    hidden: true
  },
]

export default routes
